using System;

namespace SaveGameConverter
{
    internal static class Helper
    {
        public static readonly string Boolean = GetTypeName(typeof(Boolean));
        public static readonly string Byte = GetTypeName(typeof(Byte));
        public static readonly string Int16 = GetTypeName(typeof(Int16));
        public static readonly string UInt16 = GetTypeName(typeof(UInt16));
        public static readonly string Int32 = GetTypeName(typeof(Int32));
        public static readonly string UInt32 = GetTypeName(typeof(UInt32));
        public static readonly string Int64 = GetTypeName(typeof(Int64));
        public static readonly string UInt64 = GetTypeName(typeof(UInt64));
        public static readonly string Single = GetTypeName(typeof(Single));
        public static readonly string Double = GetTypeName(typeof(Double));
        public static readonly string String = GetTypeName(typeof(String));
        public static readonly string Object = GetTypeName(typeof(Object));

        private static string GetTypeName(Type type)
        {
            string result = type.ToString();
            int dotIndex = result.LastIndexOf('.');
            if (dotIndex > 0 && dotIndex < result.Length - 1)
                result = result.Substring(dotIndex + 1);

            return result + 's';
        }
    }
}